const routerApi = require('./router')
const validateToken = require('./middleware/validateToken')
const express = require('express')
const app = express()
const path = require('path')

app.use(express.json({ limit: '50mb' }))
app.use(express.urlencoded({ limit: '50mb', extended: false }))
app.use(validateToken)

// 设置静态资源路径
app.use(express.static(path.join(__dirname) + '/public'))

app.use('/user', routerApi)
app.use('/article', routerApi)

app.listen(3000)
console.log('success listen at port:3000......')
